package com.example.houduan.Mapper;

import com.example.houduan.Pojo.MedicalPolicy;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MedicalPolicyMapper {

    @Select("select count(*) from medicalpolicy")
    int selectMedicalPolicyCount();

    List<MedicalPolicy> selectMedicalPolicyLimit(int b,int e);

    @Delete("delete from medicalpolicy where medicalpolicy_id=#{medicalpolicy_id}")
    int deleteMedicalPolicy(Integer medicalpolicy_id);

    @Update("update medicalpolicy set title=#{title},message=#{message},updatetime=#{updatetime},city_id=#{city.city_id} where medicalpolicy_id=#{medicalpolicy_id}")
    int updateMedicalPolicy(MedicalPolicy medicalPolicy);

    @Insert("insert into medicalpolicy values (#{medicalpolicy_id},#{title},#{message},#{city.city_id},#{createtime},#{updatetime})")
    int insertMedicalPolicy(MedicalPolicy medicalPolicy);

    @Select("select * from medicalpolicy")
    List<MedicalPolicy> selectAllMedicalPolicy();
}
